<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <script>

    const obj = {
      name: "zs",
      age: 18,
      gender: '男',
      hobby: "女"
    };

    // ...xxx 剩余属性，表示除了已解构的属性， 剩余属性组成的一个对象
    const { name, age, gender, hobby, ...xxx } = obj;
    // console.log('xxx  ----->  ', xxx);


    // ...yyy 剩余参数： 剩余实参组成的一个数组
    function test(a, ...yyy) {
      console.log('  ----->  ', yyy);
    }

    test(1, 2, 3, 4)

    // 数组的解构
    const list = [1, 2, 3, 4]
    const [, b, c] = list;
    console.log('b, c  ----->  ', b, c);
  </script>

</body>

</html>